Skip to content

fix(evolution): resolve committee cert redeemers to their certificate index (#518) - #642

Open
Kshot3000 wants to merge 1 commit into
IntersectMBO:mainfrom
Kshot3000:fix/committee-cert-redeemer-index
Open

Kshot3000 wants to merge 1 commit into
IntersectMBO:mainfrom
Kshot3000:fix/committee-cert-redeemer-index

Conversation

@Kshot3000

@Kshot3000 Kshot3000 commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

Fixes #518. authCommitteeHot and resignCommitteeCold store a Plutus-script committee cold credential's redeemer under cert:{coldCredentialHash}, but the certificate lookup that resolves that key to a certificate index never checked committeeColdCredential, so the redeemer was dropped and the transaction could not be built.

The lookup exists in two places, and both had the same gap:

  • txBuilder.ts: the cert index lookup matched only stakeCredential and drepCredential; an unresolved key logged a warning and the redeemer was skipped. (On current main this lookup lives in the shared makeRedeemerIndexer helper, which assembly and the fee estimate both use — the fix sits there, so both now resolve committee cert redeemers to the same index.)
  • Evaluation.ts (script evaluation): the certificate index map was built from the same two fields, so evaluation never associated the redeemer with a purpose either — in practice the build failed there first, with Evaluation returned zero results despite having … once the assembled pre-evaluation transaction came back with no cert redeemer for the evaluator to price.

Both now also match committeeColdCredential (the credential on AuthCommitteeHotCert and ResignCommitteeColdCert), in the same shape as the existing branches.

Deliberately left out

The issue's second suggestion — failing instead of warning when a cert redeemer cannot be resolved. Warn-and-continue is the shared behaviour of that assembly loop for every redeemer tag (mint, cert, reward, vote), so changing the failure semantics for cert alone is a broader behaviour change than the index fix; I left it for maintainer direction rather than deciding it in this PR. After this fix, a committee cert redeemer resolves, so the warning path is only reachable for a key that names no certificate at all.

Tests

New file TxBuilder.PlutusCCCert.test.ts (4 tests), all verified red on main first, one at a time:

  • Plutus-script authCommitteeHot with a redeemer: on main the build failed in evaluation; after the fix it emits one cert redeemer at index 0 with the evaluator's ExUnits, the Plutus V3 script in the witness set, and a script data hash.
  • Index positioning: a key-hash authCommitteeHot first and the Plutus one second — the redeemer is emitted at index 1 (the committee certificate's own index), with the ExUnits the evaluator returned for index 1.
  • Plutus-script resignCommitteeCold with a redeemer: one cert redeemer at index 0.
  • Control (passes on main too): a key-hash cold credential emits no redeemer, even when one is supplied — native-script and key-hash committee flows are unchanged (the existing TxBuilder.NativeScriptCCCert suite also still passes).

Full suite: 1747 passed / 75 skipped / 0 failed (109 test files: 108 passed, 1 skipped) — current main's 1743 baseline plus the 4 new tests. tsc --noEmit and eslint clean; a patch changeset is included.


Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.

@Kshot3000
Kshot3000 force-pushed the fix/committee-cert-redeemer-index branch from 9f253ef to c63f5eb Compare October 16, 2026 23:58
@Kshot3000

Copy link
Copy Markdown
Author

Rebased onto current main (c63f5eb) — this PR had gone conflicting after #652/#654/#655/#656/#658 landed in the same files.

The rebase was not purely mechanical: upstream refactored the assembly loop's inline index lookups into a shared makeRedeemerIndexer helper in txBuilder.ts, used by both assembly and the fee estimate. The committee-cold-credential check now sits in that helper's cert case, in the same shape as the existing stake/DRep branches, so assembly and fee sizing resolve the same index. The Evaluation.ts half of the fix is unchanged — upstream did not touch that file. I also re-verified the fix is still needed on current main: nothing upstream resolves committeeColdCredential to a certificate index.

Re-verification on the rebased branch:

  • The 4 tests in TxBuilder.PlutusCCCert.test.ts pass; checked one at a time against current main without the fix, the three behavioural tests fail there (the build fails in evaluation with "Evaluation returned zero results") and the key-hash control passes both ways, as before.
  • Full suite: 1747 passed / 75 skipped / 0 failed (109 test files) — current main's 1743 baseline plus the 4 new tests. tsc --noEmit and eslint clean; prettier drift on the two touched source files is unchanged from main.

Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

txBuilder: committee cert redeemers are never resolved to a certificate index

1 participant